﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="corprulegrid.aspx.cs" Inherits="LTJ.WebPage.UserManage.rule.corprulegrid" %>
<%@ Import Namespace="LTJ.Common"%>
<%@ Register TagPrefix="dyj" Namespace="LTJ.Control" Assembly="LTJ.Control" %>
<%@ Register TagPrefix="dyjU" TagName="ajaxcarrierlist" Src="~/datacontrol/ajaxcarrierlist.ascx"%>
<%@ Register TagPrefix="dyjU" TagName="ajaxroutelist" Src="~/datacontrol/ajaxroutelinelist.ascx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>企业规则管理</title>
    <link href="../css/comm.css" type="text/css" rel="stylesheet" />
    <link href="../css/lightview.css" type="text/css" rel="stylesheet" />
    <script src="../js/jquery.js" type="text/javascript"></script>
    <script src="../js/prototype.js" type="text/javascript"></script>
    <script src="../js/scriptaculous.js?load=effects" type="text/javascript"></script>
    <script src="../js/lightview.js" type="text/javascript"></script>
    <script src="../js/effects.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="../js/common.js"></script>
    <script src="../js/jquery-choose.js" type="text/javascript"></script>
    <script type="text/javascript">
        function Check(form, checked) {
            CheckByName(form, 'cid', checked);
            checkedEnabledButton(form, 'cid', 'del');
        }
        function formcheck() {
            if (event.keyCode == 13) {
                document.getElementById("check").focus();
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="adnr">
	    <div class="adnrt">
		    <p class="mrt">
            <dyj:DropDownList runat="server" ID="ruletype" AutoPostBack="false">
                <asp:ListItem Text="请选择规则类型" Value="0" Selected="True"></asp:ListItem>
                <asp:ListItem Text="公司全局型" Value="1"></asp:ListItem>
                <asp:ListItem Text="公司线路全局型" Value="2"></asp:ListItem>
                <asp:ListItem Text="公司线路型" Value="3"></asp:ListItem>
                <asp:ListItem Text="公司港口型" Value="4"></asp:ListItem>
            </dyj:DropDownList>
            </p>
		    <p class="mrt">公司名：<input onkeydown="formcheck()" name="username" class="soon" type="text" style="width:160px;" /></p>
            <p class="mrt">目的港：<dyj:TextBox runat="server" ID="destport" Width="100" MaxLength="20" onkeydown="formcheck()"></dyj:TextBox>&nbsp;</p>
            <div class="zi2 popxg mrt mtp" style="z-index:101">
                <p class="ip1" id="ajaxcarrierlist_str" style="width:95px;">船公司</p>
                <input type="hidden" id="ajaxcarrierlist_value" name="ajaxcarrierlist_value"/>
				<span class="an"></span>
				<div class="cn" style="width:246px;" id="ajaxcarrierlist_div">
                    <dyjU:ajaxcarrierlist runat="server" ID="acarrlist" />
				</div>
            </div>
            <div class="zi2 popxg mrt mtp" style="z-index:101">
                <p class="ip1" style="width:95px;" id="ajaxroutelinedatalist_str">航线</p>
                <input type="hidden" id="ajaxroutelinedatalist_value" name="ajaxroutelinedatalist_value"/>
                <span class="an"></span>
                <div class="cn" style="width: 246px;" id="ajaxroutelinedatalist_div">
                    <dyjU:ajaxroutelist runat="server" ID="aroutelist" />
                </div>
            </div>
            <p><dyj:Button runat="server" ID="check" Text="查询" ButtonImgUrl="../images/search.gif"/></p>
	    </div>
	    <ul class="adnr2 mar_top">
            <dyj:Button ID="add" runat="server" Text="新增" ButtonImgUrl="../images/add.gif" OnClientClick="return createrOBJ();"/>&nbsp;&nbsp;
		    <dyj:Button ID="del" runat="server" Text="删除" ButtonImgUrl="../images/del.gif" Enabled="false"/>&nbsp;&nbsp;
	    </ul>
	    <div class="adnr3">
        <dyj:datagrid id="DataGrid1" runat="server" PageSize="10">
	       <Columns>
            <asp:TemplateColumn HeaderText="<input title='选中/取消' onclick='Check(this.form,this.checked)' type='checkbox' name='chkall' id='chkall' />">
                <HeaderStyle Width="20px" />
                <ItemTemplate>
                    <input id="cid" type="checkbox" onclick="checkedEnabledButton(form, 'cid', 'del')" value="<%# DataBinder.Eval(Container, "DataItem.id").ToString()%>" name="cid">
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="操作">
              <ItemTemplate>
                    <%if (OpAction(LTJ.Entity.OprateAction.Update)){%><a class="l_blue lightview" rel="iframe" title=" :: :: width:600,height:480" href="../rule/ruleedit.aspx?opmode=edit&rtype=2&rid=<%#DataBinder.Eval(Container, "DataItem.id")%>">编辑</a><%}%>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="规则类型">
              <ItemTemplate>
                    <%# DataBinder.Eval(Container, "DataItem.rtype").ToString() == "0" ? (DataBinder.Eval(Container, "DataItem.rid").ToString() == "0" ? "整柜全局价格设置" : "全局线路设置") : (DataBinder.Eval(Container, "DataItem.rtype").ToString() == "1" ? "公司航线" : "公司港口")%>
              </ItemTemplate>
            </asp:TemplateColumn>
           <asp:TemplateColumn HeaderText="公司名">
              <ItemTemplate>
                    <%# DataBinder.Eval(Container, "DataItem.rtype").ToString()=="0"?"":DataBinder.Eval(Container, "DataItem.cname").ToString()%>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="英文名">
              <ItemTemplate>
                    <%# DataBinder.Eval(Container, "DataItem.rtype").ToString()=="0"?"":DataBinder.Eval(Container, "DataItem.ecname").ToString()%>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="relater" HeaderText="联系人"></asp:BoundColumn>
            <asp:BoundColumn DataField="cphone" HeaderText="联系电话"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="调整航线">
              <ItemTemplate>
                    <%# DataBinder.Eval(Container, "DataItem.seaname").ToString() + " " + DataBinder.Eval(Container, "DataItem.boatname").ToString()%>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="portname" HeaderText="调整目的港"></asp:BoundColumn>
            <asp:BoundColumn DataField="20GP" HeaderText="20GP"></asp:BoundColumn>
            <asp:BoundColumn DataField="40GP" HeaderText="40GP"></asp:BoundColumn>
            <asp:BoundColumn DataField="40HQ" HeaderText="40HQ"></asp:BoundColumn>
          </Columns>
	    </dyj:datagrid>
	    </div>
	    <i class="tp"></i><i class="bt"></i>
    </div>
    <button id="reclick" runat="server" style="display:none"></button>
    </form>
</body>
<script type="text/javascript">
    jQuery(document).ready(function () {
        choose("popxg");
    });
    function createrOBJ() {
        Lightview.show({ href: '../rule/ruleedit.aspx?opmode=add&rtype=2', rel: 'iframe', options: { width: 600, height: 480} }); return;
    }
</script>
</html>